
/*
设备灯：由于不同的设备指示灯不同，在此集中操作
*/

#include <stdint.h>
#include "Env.h"
#include "Light.h"
#include "KeyboardBacklight.h"
#include "BSP_Keyboard.h"


void DeviceLight_Init(void){
#if 0
	if(BSP_Keyboard_IsAvailable()){
		KeyBoardBacklight_Init(envData.backlight);
	}
	else{
		Light_Init();
	}
#endif 
	Light_Init();
}

//设置灯闪烁
void DeviceLight_FlashAsync(uint8_t id, uint8_t count, uint32_t onMs, uint8_t onColor, uint32_t offMs, uint8_t offColor){
#if 0
	if(BSP_Keyboard_IsAvailable()){
		KeyBoardBacklight_Flash(count, onMs, offMs, 0);
	}
	else{
		Light_FlashAsync(id, count, onMs, onColor, offMs, offColor);
	}
#endif 
	Light_FlashAsync(id, count, onMs, onColor, offMs, offColor);
}

//恢复常态
void DeviceLight_Permanent(uint8_t id){
#if 0
	if(BSP_Keyboard_IsAvailable()){
		KeyBoardBacklight_Permanent();
	}
	else{
		Light_Permanent(id);
	}
#endif 
	Light_Permanent(id);
}


